package com.acoreful.bootsample.web;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Spring Boot HelloWorld 案例
 *
 */
@RestController
public class HelloWorldController {

    @GetMapping("hello")
    public String sayHello() {
        return "Hello,World!";
    }

	@GetMapping("testJson")
    public Map<String, Object> testJson() {
	    	Map<String, Object> map=new HashMap<>();
	    	map.put("i", 23);
	    	map.put("date",new Date());
	    	map.put("oneFlag", null);
	    	map.put("isValid", true);
	    	map.put("isNew", false);
	    	map.put("double", 242.23);
	    	map.put("name", "王珊");
	    	map.put("age", "23");
	    	map.put("str", "234234");
	    	map.put("sex", null);
	    	return map;
    }
}